<template>
	<view class="gradient_bg1 active">
		<view class="chat_header" :style="{'padding-top': statusBarHeight+'px','height': chatHeader + 'px'}">
			<view class="chat_header_bg"></view>
			<view style="width: 100%;overflow: hidden;"
			class="flex justify-between chat_nav">
				<tabNav :tabList="tabList" :selectIndex.sync="selectIndex" @handleClick="handleTabSwitch"></tabNav>
				<view class="flex items-center" style="height: 50px;">
					<u-icon name="search" color="#fff" size="28" @click="sousuo"></u-icon>
					<u-icon class="pl10" name="plus" color="#fff" size="22" @click="tianjia"></u-icon>
				</view>
			</view>
		</view>
		<view :style="{'top': navheight+'px'}" class="shang_city">
			<view v-if="pan_status==1">
				<view
					style="margin-top: 20rpx;background-color: #FFFFFF;box-sizing: border-box;padding: 30rpx 0 20rpx 30rpx;border-radius: 20rpx;">
					<view @click="tongzhi(1)" style="overflow: hidden;position: relative;">
						<text v-if="zuixin.is_look"
							style="display: inline-block;width: 24rpx;height: 24rpx;background-color: red;position: absolute;top: 0rpx;left:90rpx;border-radius: 50%;z-index:1"></text>
						<view style="float: left;width: 20%;">
							<image
								src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E7%9F%A9%E5%BD%A2%201%20%E6%8B%B7%E8%B4%9D%2024%402x.png"
								style="width: 112rpx;height: 112rpx;display: block;" mode=""></image>

						</view>
						<view style="width: 80%;float: left;padding: 8rpx 0;border-bottom: 1px solid #f5f5f5;">
							<view style="width: 100%;box-sizing: border-box;padding-right: 30rpx;">
								<view style="line-height: 50rpx;color: #000000;font-size: 30rpx;font-weight: 600;">
									通知消息
								</view>
								<view style="line-height: 50rpx;color: #999999;font-size: 24rpx;display: flex;"
									class="yihang">
									<view style="flex: 3;">
										{{(zuixin && zuixin.notice && zuixin.notice.title) || '暂无最新消息'}}
									</view>
									<view style="flex: 1;text-align: right;">
										{{(zuixin && zuixin.notice && zuixin.notice.create_time) || ''}}
									</view>

								</view>
							</view>
						</view>
					</view>
					<view @click="tongzhi(2)" style="overflow: hidden;margin-top: 30rpx;position: relative;">
						<text v-if="zuixin.interaction_count!=0"
							style="display: inline-block;background-color: red;position: absolute;top: 0rpx;left:90rpx;border-radius: 50%;font-size: 16rpx;color: #fff;text-align: center;line-height: 24rpx;height: 24rpx;width: 24rpx;border-radius: 50%;z-index: 11;"></text>
						<view style="float: left;width: 20%;">
							<image
								src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E7%9F%A9%E5%BD%A2%2014%402x.png"
								style="width: 112rpx;height: 112rpx;display: block;" mode=""></image>

						</view>
						<view style="width: 80%;float: left;padding: 8rpx 0;border-bottom: 1px solid #f5f5f5;">
							<view style="line-height: 50rpx;color: #000000;font-size: 30rpx;font-weight: 600;">
								互动消息
							</view>
							<view style="line-height: 50rpx;color: #999999;font-size: 24rpx;" class="yihang">
								{{(zuixin && zuixin.interaction && zuixin.interaction.main_content) || '还没有新的互动消息'}}
							</view>
						</view>
					</view>
					<view v-if="is_server!=1" @click="dancai">
						<!-- <view style="float: left;width: 20%;">
							<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230525/312a016b79e25a8b5aae041e151e8720.png" style="width: 112rpx;height: 112rpx;display: block;" mode=""></image>

						</view>
						<view  style="width: 80%;float: left;padding: 8rpx 0;">
							<view style="line-height: 50rpx;color: #000000;font-size: 30rpx;font-weight: 600;">
								代采客服
							</view>
							<view style="line-height: 50rpx;color: #999999;font-size: 24rpx;" class="yihang">
								{{(zuixin && zuixin.interaction && zuixin.interaction.main_content) || '还没有新的互动消息'}}
							</view>
						</view> -->

						<view class="scroll-box" style="margin-top:20rpx;">
							<view class="uni-list margintop-bar">
								<view v-if="conversationList.length > 0">
									<view v-if="item.type === 'GROUP' && item.groupProfile.type=='ChatRoom'"
										v-for="(item,index) of conversationList" :key="item.conversationID"
										:autoClose="true">
										<view class="swipe-action" @tap="handleRoute1(item.userProfile.userID,item)">
											<view class="swipe-action__content" style="position: relative;">
												<view style="overflow: hidden;width: 100%;">
													<view style="width: 110rpx;float: left;position: relative;">
														<view class="unread" v-if="item.unreadCount !== 0">
															<view class="read-text" v-if="item.unreadCount > 99">99+
															</view>
															<view class="read-text" v-if="item.unreadCount <= 99">
																{{ item.unreadCount }}
															</view>
														</view>
														<view class="avatar-box">
															<image class="t-conversation-item-avatar"
																style="border: none;"
																src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230525/312a016b79e25a8b5aae041e151e8720.png">
															</image>


														</view>
													</view>
													<view
														style="width: 80%;float: left;overflow: hidden;padding: 20rpx 0 10rpx;border-bottom: 1px solid #f5f5f5;">
														<view class="t-conversation-item-content"
															style="width: 60%;box-sizing: border-box;float: left;padding-left: 0;">
															<view class="tui-conversation-item-name"
																style="font-size: 30rpx;color: #000000;font-weight: 600;line-height: 50rpx;">
																代采客服
															</view>
															<view class="tui-conversation-lastMessage yihang"
																style="line-height: 50rpx;font-size: 24rpx;">
																{{ item.lastMessage.messageForShow }}
															</view>
														</view>
														<view class="t-conversation-item-info"
															style="width: 40%;float: left;text-align: right;line-height: 100rpx;box-sizing: border-box;padding-right: 30rpx;">
															{{item.lastMessage.lastTime * 1000 | caculateTimeago}}
														</view>
													</view>
												</view>

											</view>
										</view>
									</view>
								</view>

							</view>
						</view>

					</view>


				</view>
				<view>
					<view style="width: 100%;display: flex;box-sizing: border-box;margin: 24rpx auto 24rpx;"
						class="flex-between">
						<view @click="tan_guanbi1" class="search_people">
							找行业人脉
						</view>
						<view @click="tan_guanbi2" class="search_group">
							找行业群
						</view>
					</view>
					<view
						style="background-color: #FFFFFF;box-sizing: border-box;padding:30rpx 0 32rpx 24rpx;border-radius: 16rpx;">
						<view
							style="line-height: 32rpx;height: 32rpx;color: #000000;font-size: 28rpx;overflow: hidden;padding-bottom:32rpx"
							class="pb32">
							聊天
						</view>

						<view class="scroll-box" v-if="is_server!=1">
							<view class="uni-list margintop-bar">
								<view v-if="conversationList.length > 0">
									<u-swipe-action>
										<u-swipe-action-item @touchmove="move(index)" :ref="'swipeAction' + index"
											v-if="(item.type === 'C2C' || (item.type === 'GROUP' && item.groupProfile.type!='ChatRoom')) && item.lastMessage.lastTime!=0"
											:threshold="60"
											:options="item.isPinned ? (item.messageRemindType == 'AcceptNotNotify' ? options4 : options1) : item.messageRemindType == 'AcceptNotNotify' ? options3 : options2"
											v-for="(item,index) of conversationList" :key="item.conversationID"
											:autoClose="true"
											@click="deleteConversationList($event, item.conversationID,index)">
											<scroll-view scroll-y="true" class="scroll-Y">

												<!-- <view v-if="item.type === 'C2C' || (item.type === 'GROUP' && item.groupProfile.type!='ChatRoom')"
										v-for="(item,index) of conversationList" :key="item.conversationID"
										:autoClose="true"> -->
												<view class="swipe-action" @tap="handleRoute(item,index)">
													<view class="swipe-action__content" style="position: relative;">
														<view style="overflow: hidden;width: 100%;">
															<view style="width: 20%;float: left;position: relative;">
																<view class="unread" v-if="item.unreadCount !== 0">
																	<view class="read-text"
																		v-if="item.unreadCount > 99">99+</view>
																	<view class="read-text"
																		v-if="item.unreadCount <= 99">
																		{{ item.unreadCount }}
																	</view>
																</view>
																<view class="avatar-box" style="position: relative;">
																	<image v-if="item.type === 'C2C'"
																		class="t-conversation-item-avatar"
																		:src="item.userProfile.avatar || ''"></image>
																	<image
																		v-if="item.type === 'GROUP' && item.groupProfile.type=='ChatRoom'"
																		class="t-conversation-item-avatar"
																		style="border: 1px solid #4766BE;"
																		:src="item.groupProfile.avatar || ''"></image>
																	<image
																		v-if="item.type === 'GROUP' && item.groupProfile.type!='ChatRoom'"
																		class="t-conversation-item-avatar"
																		style="border: 1px solid #D77E28;"
																		:src="item.groupProfile.avatar || ''"></image>
																	<view
																		v-if="item.type === 'GROUP' && item.groupProfile.type=='ChatRoom'"
																		style="width: 70rpx;height: 30rpx;line-height: 30rpx;text-align: center;color: #2F5DCF;font-size: 22rpx;background-color: #D8E4FC;border-radius: 4rpx;position: absolute;bottom: 0;left: 50%;transform: translateX(-50%);">
																		代采
																	</view>
																	<view
																		v-if="item.type === 'GROUP' && item.groupProfile.type!='ChatRoom'"
																		style="width: 70rpx;height: 30rpx;line-height: 30rpx;text-align: center;color: #D77E28;font-size: 22rpx;background-color: #F8E6D0;border-radius: 4rpx;position: absolute;bottom: 0;left: 50%;transform: translateX(-50%);">
																		群聊
																	</view>
																</view>
															</view>
															<view
																style="width: 80%;float: left;overflow: hidden;padding: 20rpx 0 16rpx;border-bottom: 1px solid #f5f5f5;">
																<view class="t-conversation-item-content"
																	style="width: 60%;box-sizing: border-box;float: left;">
																	<view class="tui-conversation-item-name"
																		style="font-size: 30rpx;color: #000000;font-weight: 600;line-height: 50rpx;">
																		<text
																			v-if="item.type === 'C2C'">{{ item.userProfile.nick }}</text>
																		<text
																			v-if="item.type === 'GROUP'">{{ item.groupProfile.groupName  ||  item.groupProfile.name}}</text>
																		<!-- <text v-if="item.type === 'GROUP'">-[群聊]</text> -->
																	</view>
																	<view
																		v-if="item.type === 'GROUP' && item.lastMessage.type==='TIMCustomElem'"
																		class="tui-conversation-lastMessage"
																		style="line-height: 50rpx;font-size: 24rpx;">
																		<text>[群提示]</text>
																	</view>
																	<view v-else
																		class="tui-conversation-lastMessage yihang"
																		style="line-height: 50rpx;font-size: 24rpx;">
																		{{ item.lastMessage.messageForShow }}
																	</view>
																</view>
																<view class="t-conversation-item-info"
																	style="width: 40%;float: left;text-align: right;line-height: 100rpx;box-sizing: border-box;padding-right: 30rpx;">
																	{{item.lastMessage.lastTime * 1000 | caculateTimeago}}
																</view>
															</view>
														</view>

													</view>
													<!-- </view> -->
												</view>

											</scroll-view>
										</u-swipe-action-item>
									</u-swipe-action>
								</view>
								<u-empty v-if="xianshi_liaotian" text="暂无会话" marginTop="30"
									:icon="require('@/static/my/no-data.png')"></u-empty>
							</view>
						</view>

						<view class="scroll-box" v-if="is_server==1">
							<view class="uni-list margintop-bar">
								<view v-if="conversationList.length > 0">
									<u-swipe-action>
										<u-swipe-action-item @touchmove="move(index)" :ref="'swipeAction' + index"
											v-if="(item.type === 'C2C' || item.type === 'GROUP') && item.lastMessage.lastTime!=0"
											:threshold="60"
											:options="item.isPinned ? (item.messageRemindType == 'AcceptNotNotify' ? options4 : options1) : item.messageRemindType == 'AcceptNotNotify' ? options3 : options2"
											v-for="(item,index) of conversationList" :key="item.conversationID"
											:autoClose="true"
											@click="deleteConversationList($event, item.conversationID,index)">
											<scroll-view scroll-y="true" class="scroll-Y">


												<!-- <view v-if="item.type === 'C2C' || item.type === 'GROUP'"
											v-for="(item,index) of conversationList" :key="item.conversationID"
											:autoClose="true"> -->
												<view class="swipe-action" @tap="handleRoute(item,index)">
													<view class="swipe-action__content" style="position: relative;">
														<view style="overflow: hidden;width: 100%;">
															<view style="width: 20%;float: left;position: relative;">
																<view class="unread" v-if="item.unreadCount !== 0">
																	<view class="read-text"
																		v-if="item.unreadCount > 99">99+</view>
																	<view class="read-text"
																		v-if="item.unreadCount <= 99">
																		{{ item.unreadCount }}
																	</view>
																</view>
																<view class="avatar-box" style="position: relative;">
																	<image v-if="item.type === 'C2C'"
																		class="t-conversation-item-avatar"
																		:src="item.userProfile.avatar || ''"></image>
																	<image v-if="item.type === 'GROUP'"
																		class="t-conversation-item-avatar"
																		:src="item.groupProfile.avatar || ''"></image>
																	<view
																		v-if="item.type === 'GROUP' && item.groupProfile.type=='ChatRoom'"
																		style="width: 70rpx;height: 30rpx;line-height: 30rpx;text-align: center;color: #2F5DCF;font-size: 22rpx;background-color: #D8E4FC;border-radius: 4rpx;position: absolute;bottom: 0;left: 50%;transform: translateX(-50%);">
																		代采
																	</view>
																	<view
																		v-if="item.type === 'GROUP' && item.groupProfile.type!='ChatRoom'"
																		style="width: 70rpx;height: 30rpx;line-height: 30rpx;text-align: center;color: #D77E28;font-size: 22rpx;background-color: #F8E6D0;border-radius: 4rpx;position: absolute;bottom: 0;left: 50%;transform: translateX(-50%);">
																		群聊
																	</view>
																</view>
															</view>
															<view
																style="width: 80%;float: left;overflow: hidden;padding: 20rpx 0 10rpx;border-bottom: 1px solid #f5f5f5;">
																<view class="t-conversation-item-content"
																	style="width: 60%;box-sizing: border-box;float: left;">
																	<view class="tui-conversation-item-name"
																		style="font-size: 30rpx;color: #000000;font-weight: 600;line-height: 50rpx;">
																		<text
																			v-if="item.type === 'C2C'">{{ item.userProfile.nick }}</text>
																		<text
																			v-if="item.type === 'GROUP'">{{ item.groupProfile.groupName || item.groupProfile.name}}</text>
																		<!-- <text style="font-size: 26rpx;" v-if="item.type === 'GROUP' && item.groupProfile.type=='ChatRoom' ">-[代采客户]</text>
																	<text style="font-size: 26rpx;" v-if="item.type === 'GROUP' && item.groupProfile.type!='ChatRoom' ">-[群聊]</text> -->
																	</view>
																	<view
																		v-if="item.type === 'GROUP' && item.lastMessage.type==='TIMCustomElem'"
																		class="tui-conversation-lastMessage"
																		style="line-height: 50rpx;font-size: 24rpx;">
																		<text>[群提示]</text>
																	</view>
																	<view v-else
																		class="tui-conversation-lastMessage yihang"
																		style="line-height: 50rpx;font-size: 24rpx;">
																		{{ item.lastMessage.messageForShow }}
																	</view>
																</view>
																<view class="t-conversation-item-info"
																	style="width: 40%;float: left;text-align: right;line-height: 100rpx;box-sizing: border-box;padding-right: 30rpx;">
																	{{item.lastMessage.lastTime * 1000 | caculateTimeago}}
																</view>
															</view>
														</view>

													</view>
													<!-- </view> -->
												</view>


											</scroll-view>
										</u-swipe-action-item>
									</u-swipe-action>

								</view>
								<u-empty v-if="xianshi_liaotian" text="暂无会话" marginTop="30"
									:icon="require('@/static/my/no-data.png')"></u-empty>

							</view>
						</view>
						<view class="flex items-center justify-center" v-if="is_server!=1" @click="more"
							style="width: 100%;line-height: 60rpx;text-align: center;font-size: 26rpx;color: #666666;box-sizing: border-box;">
							查看更多
							<u-icon name="arrow-right" size="14" color="#666"></u-icon>
						</view>

					</view>
				</view>

			</view>

			<view v-if="pan_status==2">
				<view
					style="margin-top: 20rpx;background-color: #FFFFFF;box-sizing: border-box;padding:10rpx 0 10rpx 30rpx;border-radius: 16rpx;">
					<view style="line-height: 100rpx;color: #000000;font-size: 28rpx;">
						我创建的群聊
					</view>
					<view @click="qunliao(item.group_id)"
						style="overflow: hidden;margin-bottom: 30rpx;position: relative;"
						v-for="(item,index) in my_cjqz_list" :key='index' class="flex">
						<view style="width: 100rpx;overflow: hidden;" class="pr26">
							<image :src="item.avatar"
								style="width: 100rpx;height: 100rpx;border-radius: 50%;display: block;float: left;"
								mode=""></image>
						</view>
						<view class="flex-1"
							style="padding: 10rpx 100rpx 10rpx 0;box-sizing: border-box;border-bottom: 1px solid #f5f5f5;">
							<view style="color: #000000;font-size: 30rpx;font-weight: 600;line-height: 50rpx;"
								class="yihang">
								{{item.name || ''}}
							</view>
							<view style="color: #999999;font-size: 24rpx;line-height: 50rpx;" class="yihang">
								{{item.introduction || ''}}
							</view>
						</view>
						<image @click.stop="qunxiaoxi(item.group_id,1)"
							src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230510/599ed2f6afe936c26883d8be1779bb11.png"
							style="width: 50rpx;height: 50rpx;display: block;position: absolute;top: 50%;right:30rpx;transform: translateY(-50%);"
							mode=""></image>
					</view>
					<view style="text-align: center;margin-top: 20rpx;">
						<image v-if="my_cjqz_list.length==0" :src="require('@/static/my/no-data.png')"
							style="width: 334rpx;" mode="widthFix"></image>
					</view>
				</view>

				<view
					style="margin-top: 30rpx;background-color: #FFFFFF;box-sizing: border-box;padding:10rpx 0 10rpx 30rpx;border-radius: 16rpx;">
					<view style="line-height: 100rpx;color: #000000;font-size: 28rpx;">
						我加入的群聊
					</view>
					<view @click="qunliao(item.group_id)"
						style="overflow: hidden;margin-bottom: 30rpx;position: relative;"
						v-for="(item,index) in my_jrqz_list" :key='index'>
						<view style="float: left;width: 23%;overflow: hidden;">
							<image :src="item.avatar"
								style="width: 100rpx;height: 100rpx;border-radius: 50%;display: block;float: left;margin-top: 6rpx;"
								mode=""></image>
						</view>
						<view
							style="width: 77%;float: left;padding: 10rpx 100rpx 10rpx 0;box-sizing: border-box;border-bottom: 1px solid #f5f5f5;">
							<view style="color: #000000;font-size: 30rpx;font-weight: 600;line-height: 50rpx;"
								class="yihang">
								{{item.name || ''}}
							</view>
							<view style="color: #999999;font-size: 24rpx;line-height: 50rpx;" class="yihang">
								{{item.introduction || ''}}
							</view>
						</view>
						<image @click.stop="qunxiaoxi(item.group_id,2)"
							src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230510/599ed2f6afe936c26883d8be1779bb11.png"
							style="width: 50rpx;height: 50rpx;display: block;position: absolute;top: 50%;right: 30rpx;transform: translateY(-50%);"
							mode=""></image>
					</view>

					<view style="text-align: center;margin-top: 20rpx;">
						<image v-if="my_jrqz_list.length==0" :src="require('@/static/my/no-data.png')"
							style="width: 334rpx;" mode="widthFix"></image>
					</view>
				</view>
			</view>


			<view v-if="pan_status==3">
				<view
					style="margin-top: 20rpx;background-color: #FFFFFF;box-sizing: border-box;padding:30rpx 0 10rpx 24rpx ;border-radius: 20rpx;">
					<view style="line-height: 32rpx;color: #000000;font-size: 28rpx;" class="pb32">
						通讯录
					</view>
					<view class="flex items-center"
						@click="liaotian(item.client.mobile2,item.client.id,item.client.name)"
						style="overflow: hidden;margin-bottom: 30rpx;position: relative;" v-for="(item,index) in list1"
						:key='index'>
						<view style="float: left;width: 100rpx;overflow: hidden;" class="mr20">
							<image :src="item.client.avatar"
								style="width: 100rpx;height: 100rpx;border-radius: 50%;display: block;float: left;margin-top: 6rpx;"
								mode=""></image>
						</view>
						<view class="flex-1"
							style="padding: 10rpx 100rpx 10rpx 0;border-bottom: 1px solid #f5f5f5;box-sizing: border-box;">
							<view style="color: #000000;font-size: 30rpx;font-weight: 600;line-height: 50rpx;"
								class="yihang">
								{{item && item.client_name || ''}}
							</view>
							<view style="color: #999999;font-size: 24rpx;line-height: 50rpx;" class="yihang">
								{{(item && item.client && item.client.company) || '暂无公司'}}
							</view>
						</view>
						<image @click.stop="shezhi(item,index)"
							src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230510/56538b9245eb6fe381f88eac6090921c.png"
							style="width: 50rpx;height: 50rpx;display: block;position: absolute;top: 50%;right: 30rpx;transform: translateY(-50%);"
							mode=""></image>
					</view>
					<view style="text-align: center;margin-top: 20rpx;">
						<image v-if="kk1" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"
							mode="widthFix"></image>
					</view>
				</view>
			</view>


		</view>
		<uni-popup id="popup" ref="popup1" :type="type_status" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示1
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的手机号</view>
				<view class="footer">
					<button @click="quxiao1"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @getphonenumber="login1" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getPhoneNumber">确定</button>

				</view>
			</view>
		</uni-popup>

		<uni-popup id="popup" ref="popup2" :type="ceng" :animation="true">
			<view class=""
				style="background-color: #F8F8F8;border-radius: 20upx 20rpx 0 0;width: 100%;box-sizing: border-box;padding: 30rpx 0;">
				<view style="width: 100%;box-sizing: border-box;padding: 0 46rpx;">
					<view style="color: #333333;font-weight: 600;font-size: 36rpx;line-height: 50rpx;">
						{{name || ''}}
					</view>
					<view style="color: #666666;font-weight: 600;font-size: 26rpx;line-height: 50rpx;">
						{{(user_xx && user_xx.client && user_xx.client.company) || '暂无公司'}}
					</view>
				</view>
				<view
					style="width: 93%;box-sizing: border-box;border-radius: 10rpx;background-color: #fff;margin: 30rpx auto 0;font-weight: 600;">
					<view
						style="line-height: 114rpx;overflow: hidden;border-bottom: 1px solid #eee;box-sizing: border-box;padding: 0 36rpx;position: relative;">
						<text style="float: left;color: #333333;font-size: 30rpx;">在通讯录列表置顶</text>
						<switch :checked="user_xx.is_top==1" color="#1fb0ac" @change="sw_change"
							style="position: absolute;top: 50%;right: 14rpx;transform:translateY(-50%) scale(0.7);" />
					</view>
					<view
						style="line-height: 114rpx;overflow: hidden;border-bottom: 1px solid #eee;box-sizing: border-box;padding: 0 36rpx;">
						<text style="float: left;color: #333333;font-size: 30rpx;">设置备注名</text>
						<image @click="sz_bz" src="@/static/msg/remarks.png"
							style="width: 48rpx;height: 48rpx;display: block;float: right;margin-top: 37rpx;" mode="">
						</image>
					</view>
					<view style="line-height: 114rpx;overflow: hidden;box-sizing: border-box;padding: 0 36rpx;">
						<text style="float: left;color: #E60012;font-size: 30rpx;">取消关注</text>
						<image @click="qx_gz"
							src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230510/710f6d5a4841aa58e98045bf465da4c2.png"
							style="width: 40rpx;height: 40rpx;display: block;float: right;margin-top: 37rpx;" mode="">
						</image>
					</view>
				</view>
			</view>
		</uni-popup>


		<uni-popup id="popup" ref="popup3" :type="type_status" :animation="true">
			<view style="border-radius: 20upx;width: 570rpx;background-color: #FFFFFF;">
				<view class="" style="padding:10upx 30upx 0;box-sizing: border-box;width: 100%;">
					<view
						style="text-align: center;height: 40rpx;line-height: 40rpx;color: #262D2C;font-weight: 500;font-size: 34rpx;padding-top: 64rpx"
						class="pb32">
						设置备注
					</view>
					<!-- <view
						style="text-align: center;height: 40upx;line-height: 40upx;color: #666666;font-size:28rpx;margin:0 0 20rpx 0;">
						填入朋友的通讯录名称
					</view> -->
					<view style="position: relative;background-color: #F3F3F3;border-radius: 10rpx;">
						<input placeholder="请输入备注名" v-model="name" type="text"
							style="width: 100%;height:80rpx;line-height: 80rpx;box-sizing: border-box;padding: 0 80rpx 0 30rpx;color: #333333;font-size: 28rpx;"
							placeholder-style="color:#999;">
						<image @click="qingchu" v-if="name!=''"
							src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230518/cd61a2e6ae68c05bd7332aaddf92ef0f.png"
							style="width: 34rpx;height: 34rpx;display: block;position: absolute;top: 50%;right: 30rpx;transform: translateY(-50%);"
							mode=""></image>
					</view>

				</view>
				<view style="margin-top: 50rpx;border-top: 1px solid #EEEEEE;display: flex;line-height: 88rpx;">
					<view @click="bz_qx"
						style="flex: 1;color: #666666;font-size: 30rpx;text-align: center;border-right: 1px solid #eee;">
						取消
					</view>
					<view @click="bz_qr" style="flex: 1;color: #18A9A5;font-size: 30rpx;text-align: center;">
						确认
					</view>
				</view>
			</view>
		</uni-popup>


		<view v-if="xianshi" @click="tan_guanbi"
			style="position: fixed;top: 0;left: 0;background-color: rgba(0, 0, 0, 0.5);width: 100%;height: 100vh;z-index: 999;">
			<view class="zhaoren" :style="{'top': navheight+32+'px'}">
				<view
					style="width: 260rpx;border-radius: 10rpx;background-color: #fff;border-radius: 16rpx;position: relative;">
					<image
						src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230606/19d1953eb70bd4863fc595e703547b5e.png"
						style="width: 26rpx;height: 14rpx;display: block;position: absolute;top: -14rpx;right: 30rpx;"
						mode=""></image>
					<view @click.stop="tan_guanbi1"
						style="line-height: 90rpx;font-size: 26rpx;box-sizing: border-box;padding: 0 0 0 30rpx;overflow: hidden;">
						<view style="width: 25%;float: left;">
							<image src="@/static/msg/PersonAdd.png"
								style="width: 40rpx;height: 40rpx;float: left;margin-top: 25rpx;display: block;"
								mode=""></image>
						</view>
						<view style="width: 75%;float: left;border-bottom: 1px solid #eee;color: #000;">
							人脉
						</view>
					</view>
					<view @click.stop="tan_guanbi2"
						style="line-height: 90rpx;font-size: 26rpx;box-sizing: border-box;padding: 0 0 0 30rpx;overflow: hidden;">
						<view style="width: 25%;float: left;">
							<image src="@/static/msg/business-group.png"
								style="width: 40rpx;height: 40rpx;float: left;margin-top: 25rpx;display: block;"
								mode=""></image>
						</view>
						<view style="width: 75%;float: left;border-bottom: 1px solid #eee;color: #000;">
							行业群
						</view>
					</view>
					<view @click.stop="tan_guanbi3"
						style="line-height: 90rpx;font-size: 26rpx;box-sizing: border-box;padding: 0 0 0 30rpx;overflow: hidden;">
						<view style="width: 25%;float: left;">
							<image src="@/static/msg/group_chat.png"
								style="width: 40rpx;height: 40rpx;float: left;margin-top: 25rpx;display: block;"
								mode=""></image>
						</view>
						<view style="width: 75%;float: left;color: #000;">
							创建群聊
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-if="tc_is_show"
			style="width: 100%;height: 100vh;background: rgb(0,0,0,.5);position: fixed;top:100rpx;left: 0;z-index: 900;">
			<view style="position: relative;height: 100%;width: 100%;">
				<view style="position: absolute;top: 15%;left: 50%;transform: translateX(-50%);">
					<image @click="bgtu_tiao" :src="tc_image" style="width: 600rpx;height: 800rpx;">
					</image>
					<view class="" @click="bgguan" style="text-align: center;width: 100%;margin-top: 50rpx;">
						<image src="../../static/guanbi.png" style="width: 60rpx;height: 60rpx;"></image>
					</view>
				</view>
			</view>
		</view>
		<!-- <view @click="zz_qx" v-if="zhezhao" style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;z-index: 9999;">

		</view> -->
		<mrhardTabbar :newsNum="num"></mrhardTabbar>

		<!-- <text v-if="zuixin.chat_look==true && num==0"
			style="width: 24rpx;height: 24rpx;text-align: center;display: inline-block;background-color: red;font-size: 20rpx;color: #fff;text-align: center;border-radius: 50%;position: fixed;bottom: 120rpx;right: 180rpx;z-index: 300;"></text>
		<text v-if="num!=0 && num<100"
			style="width: 24rpx;height: 24rpx;text-align:center;display: inline-block;background-color: red;font-size: 20rpx;color: #fff;border-radius: 24rpx;position: fixed;bottom: 110rpx;right: 180rpx;z-index: 300;padding:2rpx 8rpx;">{{num}}</text>
		<text v-if="num!=0 && num>=100"
			style="display: inline-block;background-color: red;font-size: 20rpx;color: #fff;border-radius: 50%;position: fixed;bottom: 110rpx;right: 180rpx;z-index: 300;padding:2rpx 8rpx;border-radius: 14rpx;">99+</text> -->
		<noLoginToast ref="noLoginToast" />
	</view>
</template>

<script>
	import {
		validateNull
	} from '@/common'
	import isAuditIos from '@/common/isAuditIos.js'
	import TUIConversationItem from '../../components/tui-conversation/conversation-item/index';
	import TUIConversationItem1 from '../../components/tui-conversation/conversation-item1/index';
	import mrhardTabbar from "../../components/mrhard-tabbar.vue";
	import {
		genTestUserSig
	} from '@/im/debug/GenerateTestUserSig.js';
	const app = getApp();
	import TIM from 'tim-wx-sdk/tim-wx-friendship.js';
	import COS from 'cos-wx-sdk-v5';
	export default {
		components: {
			mrhardTabbar,
			TUIConversationItem,
			TUIConversationItem1
		},
		mixins: [isAuditIos],
		data() {
			return {
				chatHeader: 50,
				bgcolor: 'transparent',
				tc_is_show: false,
				tc_image: '',
				scrollTop: 0,
				navheight: 0,
				statusBarHeight: 0,
				menuHeight: 0,
				haveBack: false,
				btnHeight: 30,
				btnWidth: 70,
				isScroll: true,
				slotheight: '0',
				xiao: true,
				xScale: 0,

				page: 1,
				list: [],
				enmpy: false,
				kk: false,
				zuixin: {
					notice: {
						title: ''
					},
					interaction: {
						title: '',
						content: '',
						main_content: ''
					}
				},
				type_status: 'center',
				interaction_count: '',
				pan_status: 1,
				ceng: 'bottom',
				my_cjqz_list: [],
				my_jrqz_list: [],


				page1: 1,
				list1: [],
				enmpy1: false,
				kk1: false,

				user_xx: {},
				index: '',
				name: '',
				user_xinxi: {},


				page2: 1,
				list2: [],
				enmpy2: false,
				kk2: false,
				is_server: 2,
				options1: [
					// {
					//   text: '恢复',
					//   style: {
					//     backgroundColor: '#3c9cff',
					//   },
					// },
					{
						text: '删除',
						style: {
							backgroundColor: '#f56c6c',
						},
					},
					// {
					//   text: '免打扰',
					//   style: {
					//     backgroundColor: '#ffaa00',
					//   },
					// },
				],
				options4: [
					// {
					//   text: '恢复',
					//   style: {
					//     backgroundColor: '#3c9cff',
					//   },
					// },
					{
						text: '删除',
						style: {
							backgroundColor: '#f56c6c',
						},
					},
					// {
					//   text: '提醒',
					//   style: {
					//     backgroundColor: '#ffaa00',
					//   },
					// },
				],
				options2: [
					// {
					//   text: '置顶',
					//   style: {
					//     backgroundColor: '#3c9cff',
					//   },
					// },
					{
						text: '删除',
						style: {
							backgroundColor: '#f56c6c',
						},
					},
					// {
					//   text: '免打扰',
					//   style: {
					//     backgroundColor: '#ffaa00',
					//   },
					// },
				],
				options3: [
					// {
					//   text: '顶置',
					//   style: {
					//     backgroundColor: '#3c9cff',
					//   },
					// },
					{
						text: '删除',
						style: {
							backgroundColor: '#f56c6c',
						},
					},
					// {
					//   text: '提醒',
					//   style: {
					//     backgroundColor: '#ffaa00',
					//   },
					// },
				],
				conversationList: [],
				groupList: [],
				num: 0,
				xianshi: false,
				moveIndex: -1,
				zhezhao: false,
				xianshi_liaotian: false,
				pageLogin: false,
				tabList: [{
						text: '消息',
						title: '首页',
						type: 'msg',
						index: 0
					},
					{
						text: '我的群',
						title: '首页',
						type: 'group',
						index: 1
					},
					{
						text: '互关好友',
						title: '首页',
						type: 'friends',
						index: 2
					}
				],
				selectIndex: 1
			}
		},
		async onReady() {
			if (this.$refs.noLoginToast && validateNull(uni.getStorageSync('token'))) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					if (this.$refs.noLoginToast) {
						let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
						if (!isHasMobile) {
							return
						}
					}
				} else {
					return
				}
			}
			// this.afterLoginOperate()
			const timer = setTimeout(() => {
				uni.hideLoading();
				clearTimeout(timer)
			}, 1000);
		},
		async onLoad() {
			if (uni.getStorageSync('tan_type') != 1) {
				this.tankuang()
			}
		},
		async onShow() {
			this.page = 1
			this.enmpy = false
			this.kk = false
			this.list = []
			this.page1 = 1
			this.enmpy1 = false
			this.kk1 = false
			this.list1 = []
			this.page2 = 1
			this.enmpy2 = false
			this.kk2 = false
			this.list2 = []
			let token = uni.getStorageSync('token')
			if (token) {
				this.tiezi()
				this.shuju()
				this.my_cj_qz()
				this.my_jr_qz()
				this.tongxunlv()
				this.dckf()
				this.denglu_im()
				return
			} else {
				uni.setStorageSync('xiaoxi_num', 0)
				this.num = 0
				this.conversationList = []
			}
			this.is_server = uni.getStorageSync('userinfo').is_server

			// if (uni.getStorageSync('token') == '' || uni.getStorageSync('token') == null) {
			// 	this.$refs.popup.open()
			// 	return
			// }
			// else if (uni.getStorageSync('mobile') == null || uni.getStorageSync('mobile') == '') {
			// 	this.$refs.popup1.open()
			// 	return
			// }
			// else {
			// 	this.zhezhao=true
			// }
		},
		onReachBottom() {
			if (this.pan_status == 1) {
				if (this.enmpy) {
					return
				} else {
					this.tiezi()
				}
			} else if (this.pan_status == 3) {
				if (this.enmpy1) {
					return
				} else {
					this.tongxunlv()
				}
			} else if (this.pan_status == 4) {
				if (this.enmpy2) {
					return
				} else {
					this.dckf()
				}
			}

		},
		methods: {
			loginSuccess() {
				this.afterLoginOperate()
			},
			afterLoginOperate() {
				this.denglu_im()
				let isLogin = this.$store.state.isLogin
				if (isLogin) {
					this.tiezi()
					this.shuju()
					this.my_cj_qz()
					this.my_jr_qz()
					this.dckf()
					this.tongxunlv()
				}
				// this.get_user_xx()
				this.zhezhao = true
			},
			getTool() {

			},
			// 首页弹框图片
			tankuang() {
				this.post('api/index/showVipPoster', '', false).then(res => {
					if (res.code == 1) {
						if (res.data.status == 1) {
							this.tc_is_show = true
							this.tc_image = res.data.poster
						} else {
							this.tc_is_show = false
						}
					}
				})
			},

			// 优惠券
			async bgtu_tiao() {
				this.tc_is_show = false
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				if (this.iosUpAppStore) {
					uni.navigateTo({
						url: '/subpages/pages/vip'
					})
				}
			},
			// 背景关闭
			bgguan() {
				this.tc_is_show = false
				uni.setStorageSync('tan_type', '1')
			},
			async more() {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.navigateTo({
					url: '/sub/pages/ls_ren'
				})
			},
			dingyue() {
				uni.getSetting({
					withSubscriptions: true, //是否获取用户订阅消息的订阅状态，默认false不返回
					success(res) {
						if (!res.subscriptionsSetting.mainSwitch) {
							uni.showModal({
								title: '温馨提示',
								content: "检测到您没有开启订阅消息的权限，是否去设置？",
								success(modal) {
									if (modal.confirm) { // 点击肯定
										uni.openSetting({
											withSubscriptions: true
										});
									} else {
										uni.showToast({
											title: "您已拒绝订阅消息授权，无法预约领取",
											icon: "none",
											duration: 1000
										})
									}
								}
							})

						} else {
							uni.requestSubscribeMessage({
								tmplIds: ['Ec-vIHBRhcDWboCW5VcBEUYTUwD9q_7IjxGwUvlCj3M'],
								success(res) {


								}
							})
						}


					}
				})
			},

			move(index) {
				if (this.moveIndex == index) return
				this.moveIndex = index
			},

			closeSwipeAction() {
				let test = 'swipeAction' + this.moveIndex
				if (this.moveIndex != -1) {
					this.$refs[test][0].closeHandler()
				}
			},
			async deleteConversationList(e, value, index) {
				let that = this
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.showModal({
					content: "确认删除会话？",
					success: (res) => {
						if (res.confirm) {
							uni.$TUIKit
								.deleteConversation(value)
								.then(function(imResponse) {
									//删除成功。
									const {
										conversationID
									} = imResponse.data; // 被删除的会话 ID。
									that.closeSwipeAction();
									if (this.is_server != 1) {
										for (let i = 0; i < this.conversationList.length; i++) {
											if (this.conversationList[i].type === 'C2C') {
												this.xianshi_liaotian = false
												return
											}
											if ((this.conversationList[i].type === 'GROUP' && this
													.conversationList[i].groupProfile.type ==
													'ChatRoom') && this.conversationList.length > 2) {
												this.xianshi_liaotian = false
												return
												// item.type === 'C2C' || (item.type === 'GROUP' && item.groupProfile.type!='ChatRoom')
											}
											if ((this.conversationList[i].type === 'GROUP' && this
													.conversationList[i].groupProfile.type ==
													'ChatRoom') && this.conversationList.length <= 2) {
												this.xianshi_liaotian = true
												return
											}
										}
									} else {
										for (let i = 0; i < this.conversationList.length; i++) {
											if (this.conversationListitem.type === 'C2C' || this
												.conversationListitem.type === 'GROUP') {
												this.xianshi_liaotian = true
												return
												// item.type === 'C2C' || (item.type === 'GROUP' && item.groupProfile.type!='ChatRoom')
											} else {
												this.xianshi_liaotian = false
											}
										}
									}
								})
								.catch(function(imError) {

									console.warn('deleteConversation error:', imError); // 删除会话失败的相关信息

								});
						} else {
							that.closeSwipeAction();
						}
					},
				});


				return
				if (e.index == '0') {
					const list = this.conversationList;
					const show = list.map(item => {
						return item.isPinned;
					});
					for (var item of list) {
						if (item.conversationID == value) {
							if (show[list.indexOf(item)] === false) {
								// 置顶会话，v2.14.0起支持
								uni.$TUIKit
									.pinConversation({
										conversationID: value,
										isPinned: true,
									})
									.then(imResponse => {
										// 置顶会话成功
										const {
											conversationID
										} = imResponse.data; // 被置顶的会话 ID
									})
									.catch(function(imError) {
										console.warn('pinConversation error:', imError); // 置顶会话失败的相关信息
									});
							}
							if (show[list.indexOf(item)] === true) {
								// 取消置顶会话，v2.14.0起支持
								uni.$TUIKit
									.pinConversation({
										conversationID: value,
										isPinned: false,
									})
									.then(imResponse => {
										// 取消置顶会话成功
										const {
											conversationID
										} = imResponse.data; // 被取消置顶的会话 ID
									})
									.catch(function(imError) {
										console.warn('pinConversation error:', imError); // 取消置顶会话失败的相关信息
									});
							}
						}
					}
				}
				if (e.index == '0') {
					uni.$TUIKit
						.deleteConversation(value)
						.then(function(imResponse) {
							//删除成功。
							const {
								conversationID
							} = imResponse.data; // 被删除的会话 ID。
						})
						.catch(function(imError) {
							console.warn('deleteConversation error:', imError); // 删除会话失败的相关信息
						});
				}
				if (e.index == '2') {
					const list = this.conversationList;
					const show = list.map(item => {
						return item.conversationID;
					});
					const num = value.substring(0, 3);
					if (num === 'C2C') {
						const user = value.slice(3);
						if (list[show.indexOf(value)].messageRemindType === 'AcceptNotNotify') {
							uni.$TUIKit
								.setMessageRemindType({
									userIDList: [user],
									messageRemindType: this.TIM.TYPES.MSG_REMIND_ACPT_AND_NOTE,
								})
								.then(function(imResponse) {
									// 设置成功后 SDK 会触发 TIM.EVENT.CONVERSATION_LIST_UPDATED 事件（遍历列表，并读取 Conversation.messageRemindType）
									const {
										successUserIDList,
										failureUserIDList
									} = imResponse.data;
								})
								.catch(function(imError) {
									console.warn('setMessageRemindType error:', imError);
								});
						}
						if (list[show.indexOf(value)].messageRemindType === 'AcceptAndNotify') {
							uni.$TUIKit
								.setMessageRemindType({
									userIDList: [user],
									messageRemindType: this.TIM.TYPES.MSG_REMIND_ACPT_NOT_NOTE,
								})
								.then(function(imResponse) {
									// 设置成功后 SDK 会触发 TIM.EVENT.CONVERSATION_LIST_UPDATED 事件（遍历列表，并读取 Conversation.messageRemindType）
									const {
										successUserIDList,
										failureUserIDList
									} = imResponse.data;
								})
								.catch(function(imError) {
									console.warn('setMessageRemindType error:', imError);
								});
						}
						if (list[show.indexOf(value)].messageRemindType === '') {
							list[show.indexOf(value)].messageRemindType = 'AcceptNotNotify';
						}
					}
					if (num === 'GRO') {
						const groupID = value.slice(5);
						if (list[show.indexOf(value)].messageRemindType === 'AcceptNotNotify') {
							uni.$TUIKit
								.setMessageRemindType({
									groupID: groupID,
									messageRemindType: this.TIM.TYPES.MSG_REMIND_ACPT_AND_NOTE,
								})
								.then(function(imResponse) {})
								.catch(function(imError) {
									console.warn('setMessageRemindType error:', imError);
								});
						}
						if (list[show.indexOf(value)].messageRemindType === 'AcceptAndNotify') {
							uni.$TUIKit
								.setMessageRemindType({
									groupID: groupID,
									messageRemindType: this.TIM.TYPES.MSG_REMIND_ACPT_NOT_NOTE,
								})
								.then(function(imResponse) {})
								.catch(function(imError) {
									console.warn('setMessageRemindType error:', imError);
								});
						}
					}
				}
			},

			// deleteConversation() {
			//   uni.showModal({
			//     content: "确认删除会话？",
			//     success: (res) => {
			//       if (res.confirm) {
			//         uni.$TUIKit.deleteConversation(this.conversation.conversationID);
			//         this.setData({
			//           conversation: {},
			//           xScale: 0,
			//         });
			//       }
			//     },
			//   });
			// },

			// handleTouchMove(e) {
			//   if (!this.lock) {
			//     this.last = e.detail.x;
			//     this.lock = true;
			//   }

			//   if (this.lock && e.detail.x - this.last < -5) {
			//     this.setData({
			//       xScale: -75,
			//     });
			//     setTimeout(() => {
			//       this.lock = false;
			//     }, 2000);
			//   } else if (this.lock && e.detail.x - this.last > 5) {
			//     this.setData({
			//       xScale: 0,
			//     });
			//     setTimeout(() => {
			//       this.lock = false;
			//     }, 2000);
			//   }
			// },







			// 代采客户
			async dckf() {
				if (this.$refs.noLoginToast) {
					let isLogin = await this.$refs.noLoginToast.open()
					if (isLogin) {
						let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
						if (!isHasMobile) {
							return
						}
					} else {
						return
					}
				}
				this.post1('api/im/im/server_friend_list', {
					page: this.page2,
					limit: 10
				}, false).then(res => {
					if (res.code == 1) {
						if (this.page2 == 1) {
							if (res.data.data == null || res.data.data.length == 0) {
								this.kk2 = true
								this.enmpy2 = true
								return
							} else if (res.data.data.length < 15) {
								this.enmpy2 = true
							}
						} else {
							if (res.data.data == null || res.data.data.length == 0) {
								this.enmpy2 = true
								return
							} else if (res.data.data.length < 15) {
								this.enmpy2 = true
							}
						}

						this.page2++
						this.list2.push(...res.data.data)
					} else {
						this.kk2 = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},


			denglu_im() {
				let that = this
				const userID = uni.getStorageSync('mobile2').toString();
				if (!userID) {
					return
					uni.showToast({
						title: '请先登录',
						icon: "none",
						duration: 1000
					})
					return
				}
				const userSig = genTestUserSig(userID).userSig;
				app.globalData.userInfo = {
					userSig,
					userID
				};

				uni.setStorageSync('userInfo', app.globalData.userInfo);
				// 登录腾讯im
				uni.$TUIKit
					.login({
						userID: userID,
						userSig: userSig
					})
					.then(res => {
						// this.$u.toast('消息页im登录成功')
						this.$store.commit('setToken', app.globalData.userInfo);
						uni.$TUIKit.on(uni.$TUIKitEvent.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated);
						setTimeout(function() {
							that.getConversationList();
						}, 500)
					})
					.catch(() => {});
			},
			onConversationListUpdated(event) {
				let that = this
				this.conversationList = event.data;
				this.num = 0
				for (let i = 0; i < this.conversationList.length; i++) {
					if (this.conversationList[i].type != '@TIM#SYSTEM') {
						this.num += this.conversationList[i].unreadCount
					}
				}
				that.post1('api/im/im/remark_client', '', false).then(res => {
					if (res.code == 1) {
						for (let i = 0; i < that.conversationList.length; i++) {
							for (let m = 0; m < res.data.length; m++) {
								if (that.conversationList[i].type == 'C2C' && that.conversationList[i].userProfile
									.userID == res.data[m].mobile2.toString()) {
									that.conversationList[i].userProfile.nick = res.data[m].remark_name
								}
							}
						}
					}
				})
				uni.setStorageSync('xiaoxi_num', this.num)
				this.setBadgeNumber(this.num)
				if (this.is_server != 1) {
					for (let i = 0; i < this.conversationList.length; i++) {
						if (this.conversationList[i].type === 'C2C') {
							this.xianshi_liaotian = false
							return
						}
						if ((this.conversationList[i].type === 'GROUP' && this.conversationList[i].groupProfile.type ==
								'ChatRoom') && this.conversationList.length > 2) {
							this.xianshi_liaotian = false
							return
							// item.type === 'C2C' || (item.type === 'GROUP' && item.groupProfile.type!='ChatRoom')
						}
						if ((this.conversationList[i].type === 'GROUP' && this.conversationList[i].groupProfile.type ==
								'ChatRoom') && this.conversationList.length <= 2) {
							this.xianshi_liaotian = true
							return
						}
					}
				} else {
					for (let i = 0; i < this.conversationList.length; i++) {
						if (this.conversationListitem.type === 'C2C' || this.conversationListitem.type === 'GROUP') {
							this.xianshi_liaotian = true
							return
							// item.type === 'C2C' || (item.type === 'GROUP' && item.groupProfile.type!='ChatRoom')
						} else {
							this.xianshi_liaotian = false
						}
					}
				}
			},
			setBadgeNumber(badgeNumber) {
				if (plus.os.name.toLowerCase() === 'ios') {
					var UIApplication = plus.ios.importClass("UIApplication");
					var app = UIApplication.sharedApplication();
					var count = parseInt(badgeNumber);
					// 设置角标数字
					app.setApplicationIconBadgeNumber(count);
				}
			},

			getConversationList() {
				let that = this
				uni.$TUIKit.getConversationList().then(imResponse => {
					this.conversationList = [...imResponse.data.conversationList];
					this.num = 0
					for (let i = 0; i < this.conversationList.length; i++) {
						if (this.conversationList[i].type != '@TIM#SYSTEM') {
							this.num += this.conversationList[i].unreadCount
							this.conversationList[i].check = false
						}
					}

					uni.setStorageSync('xiaoxi_num', this.num)
					this.setBadgeNumber(this.num)
					that.post1('api/im/im/remark_client', '', false).then(res => {
						if (res.code == 1) {
							for (let i = 0; i < that.conversationList.length; i++) {
								for (let m = 0; m < res.data.length; m++) {
									if (that.conversationList[i].type == 'C2C' && that.conversationList[i]
										.userProfile.userID == res.data[m].mobile2.toString()) {
										that.conversationList[i].userProfile.nick = res.data[m].remark_name
									}
								}
							}
						}
					})
					that.$forceUpdate()
					if (this.is_server != 1) {
						for (let i = 0; i < this.conversationList.length; i++) {
							if (this.conversationList[i].type === 'C2C') {
								this.xianshi_liaotian = false
								return
							}
							if ((this.conversationList[i].type === 'GROUP' && this.conversationList[i].groupProfile
									.type == 'ChatRoom') && this.conversationList.length > 2) {
								this.xianshi_liaotian = false
								return
								// item.type === 'C2C' || (item.type === 'GROUP' && item.groupProfile.type!='ChatRoom')
							}
							if ((this.conversationList[i].type === 'GROUP' && this.conversationList[i].groupProfile
									.type == 'ChatRoom') && this.conversationList.length <= 2) {
								this.xianshi_liaotian = true
								return
							}
						}
					} else {
						for (let i = 0; i < this.conversationList.length; i++) {
							if (this.conversationListitem.type === 'C2C' || this.conversationListitem.type ===
								'GROUP') {
								this.xianshi_liaotian = true
								return
								// item.type === 'C2C' || (item.type === 'GROUP' && item.groupProfile.type!='ChatRoom')
							} else {
								this.xianshi_liaotian = false
							}
						}
					}

				});
			},
			async handleRoute(event, index) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				let that = this
				if (event.type === 'C2C') {
					let aid = 'C2C' + this.conversationList[index].userProfile.userID
					this.post1('api/client/info', '', false).then(res => {
						if (res.code == 1) {
							that.post1('api/im/im/friend_msg', {
								client_id: 0,
								client_mobile: that.conversationList[index].userProfile.userID
							}, false).then(res => {
								if (res.code == 1) {
									uni.setStorageSync('friend_id', res.data.friend_id)
									// uni.setStorageSync('friend_name',id)
									uni.navigateTo({
										url: `/im/chat/chat?conversationID=${aid}`,
									});
								} else if (res.code == 211) {
									uni.showModal({
										title: '提示',
										content: res.msg,
										success(res1) {
											if (res1.confirm) {
												if (that.iosUpAppStore) {
													uni.navigateTo({
														url: '/subpages/pages/vip'
													})
												}
											} else if (res1.cancel) {

											}
										}
									});
								} else {
									uni.showToast({
										title: res.msg,
										icon: "none",
										duration: 1000
									})
								}
							})
						}
					})
				} else {
					let aid = this.conversationList[index].conversationID
					if (event.groupProfile.type == 'ChatRoom') {
						this.post1('api/im/im/purchasing', {
							group_id: event.conversationID
						}, false).then(res => {

							if (res.code == 1) {
								if (uni.getStorageSync('userinfo').is_server == 1) {
									uni.setStorageSync('user_id', res.data.user.id)
									uni.setStorageSync('friend_name', res.data.user.remark_name || res.data
										.user
										.name)
								} else {
									uni.setStorageSync('user_id', 0)
									uni.setStorageSync('friend_name', res.data.server.name)
								}

								uni.navigateTo({
									url: `/im/chat/dan_chat?conversationID=${aid}`,
									// url: `/im/login/login`,
								})
							} else {
								uni.showToast({
									title: res.msg,
									icon: "none",
									duration: 1000
								})
							}
						})
						return
					} else {

						this.post1('api/client/info', '', false).then(res => {
							if (res.code == 1) {
								that.post1('api/im/im/check_group', {
									group_id: that.conversationList[index].conversationID.substr(
										5)
								}, false).then(re => {
									if (re.code == 1) {
										uni.setStorageSync('group_id', that.conversationList[index]
											.conversationID.substr(
												5))
										uni.navigateTo({
											url: `/im/chat/group_chat?conversationID=${aid}`,
											// url: `/im/login/login`,
										})
									} else if (re.code == 211) {
										uni.showModal({
											title: '提示',
											content: re.msg,
											success(res1) {
												if (res1.confirm) {
													if (that.iosUpAppStore) {
														uni.navigateTo({
															url: '/subpages/pages/vip'
														})
													}
												} else if (res1.cancel) {

												}
											}
										});
									} else {
										uni.showToast({
											title: re.msg,
											icon: "none",
											duration: 1000
										})
									}
								})
								return
								if (res.data.is_vip == 1) {
									uni.setStorageSync('group_id', that.conversationList[index].conversationID
										.substr(
											5))
									uni.navigateTo({
										url: `/im/chat/group_chat?conversationID=${aid}`,
										// url: `/im/login/login`,
									})
								} else if (res.data.is_vip == 2) {
									uni.showModal({
										title: '提示',
										content: '您的会员已到期,只有会员才可以聊天,请前去续费会员！',
										success(res1) {
											if (res1.confirm) {
												uni.navigateTo({
													url: '/subpages/pages/vip'
												})
											} else if (res1.cancel) {

											}
										}
									});
								} else if (res.data.is_vip == 0) {
									uni.showModal({
										title: '提示',
										content: '只有会员才可以聊天,请前去开通会员！',
										success(res1) {
											if (res1.confirm) {
												uni.navigateTo({
													url: '/subpages/pages/vip'
												})
											} else if (res1.cancel) {

											}
										}
									});
								}
							}
						})
					}

				}



			},
			async liaotian(id, client_id, name) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				let aid = 'C2C' + id
				let that = this
				this.post1('api/client/info', '', false).then(res => {
					if (res.code == 1) {
						that.post1('api/im/im/friend_msg', {
							client_id: client_id
						}, false).then(res => {
							if (res.code == 1) {
								uni.setStorageSync('friend_id', res.data.friend_id)
								uni.setStorageSync('friend_name', name)
								uni.navigateTo({
									url: `/im/chat/chat?conversationID=${aid}`,
									// url: `/im/login/login`,
								})
							} else if (res.code == 211) {
								uni.showModal({
									title: '提示',
									content: res.msg,
									success(res1) {
										if (res1.confirm) {
											if (that.iosUpAppStore) {
												uni.navigateTo({
													url: '/subpages/pages/vip'
												})
											}
										} else if (res1.cancel) {

										}
									}
								});
							} else {
								uni.showToast({
									title: res.msg,
									icon: "none",
									duration: 1000
								})
							}
						})
					}
				})
			},
			async handleRoute1(id) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.setStorageSync('group_id', id)
				uni.navigateTo({
					url: `/im/chat/group_chat?conversationID=${id}`,
					// url: `/im/login/login`,
				})


			},
			async dan_liaotian(id, client_id, name) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				// let aid='C2C'+id
				this.post1('api/im/im/purchasing', {
					user_id: client_id
				}, false).then(res => {
					if (res.code == 1) {
						let aid = 'GROUP' + res.data.group_id
						if (uni.getStorageSync('userinfo').is_server == 1) {
							uni.setStorageSync('user_id', res.data.user.id)
						} else {
							uni.setStorageSync('user_id', 0)
						}

						uni.setStorageSync('friend_name', name)
						uni.navigateTo({
							url: `/im/chat/dan_chat?conversationID=${aid}`,
							// url: `/im/login/login`,
						})
					} else {
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})



			},

			async dancai() {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.post1('api/im/im/purchasing', {
					brand_id: '-1'
				}, false).then(res => {

					if (res.code == 1) {
						let aid = 'GROUP' + res.data.group_id
						if (uni.getStorageSync('userinfo').is_server == 1) {
							uni.setStorageSync('user_id', res.data.user.id)
						} else {
							uni.setStorageSync('user_id', 0)
						}
						uni.setStorageSync('friend_name', res.data.server.name)
						uni.navigateTo({
							url: `/im/chat/dan_chat?conversationID=${aid}`,
							// url: `/im/login/login`,
						})
					} else {
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})



			},


			async qunliao(id) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				let aid = 'GROUP' + id
				let that = this

				this.post1('api/client/info', '', false).then(res => {
					if (res.code == 1) {
						that.post1('api/im/im/check_group', {
							group_id: id
						}, false).then(re => {
							if (re.code == 1) {
								uni.setStorageSync('group_id', id)
								uni.navigateTo({
									url: `/im/chat/group_chat?conversationID=${aid}`,
									// url: `/im/login/login`,
								})
							} else if (re.code == 211) {
								uni.showModal({
									title: '提示',
									content: re.msg,
									success(res1) {
										if (res1.confirm) {
											if (that.iosUpAppStore) {
												uni.navigateTo({
													url: '/subpages/pages/vip'
												})
											}
										} else if (res1.cancel) {

										}
									}
								});
							} else {
								uni.showToast({
									title: re.msg,
									icon: "none",
									duration: 1000
								})
							}
						})
						return


						if (res.data.is_vip == 1) {

						} else if (res.data.is_vip == 2) {
							uni.showModal({
								title: '提示',
								content: '您的会员已到期,只有会员才可以聊天,请前去续费会员！',
								success(res1) {
									if (res1.confirm) {
										uni.navigateTo({
											url: '/subpages/pages/vip'
										})
									} else if (res1.cancel) {

									}
								}
							});
						} else if (res.data.is_vip == 0) {
							uni.showModal({
								title: '提示',
								content: '只有会员才可以聊天,请前去开通会员！',
								success(res1) {
									if (res1.confirm) {
										uni.navigateTo({
											url: '/subpages/pages/vip'
										})
									} else if (res1.cancel) {

									}
								}
							});
						}
					}
				})



			},
			// 群组
			// 我创建的群组
			my_cj_qz() {
				this.post1('api/im/im/my_create_group', '', false).then(res => {
					if (res.code == 1) {
						this.my_cjqz_list = res.data
					}
				})
				this.$forceUpdate()
			},
			// 我加入的群聊
			my_jr_qz() {
				this.post1('api/im/im/my_join_group', '', false).then(res => {
					if (res.code == 1) {
						this.my_jrqz_list = res.data
					}
				})
			},


			// 通讯录
			// 获取通讯录
			tongxunlv() {
				let data = {
					page: this.page1,
					limit: 15
				}
				this.post1('api/im/im/friend_list', data, false).then(res => {
					if (res.code == 1) {
						if (this.page1 == 1) {
							if (res.data.data == null || res.data.data.length == 0) {
								this.kk1 = true
								this.enmpy1 = true
								return
							} else if (res.data.data.length < 15) {
								this.enmpy1 = true
							}
						} else {
							if (res.data.data == null || res.data.data.length == 0) {
								this.enmpy1 = true
								return
							} else if (res.data.data.length < 15) {
								this.enmpy1 = true
							}
						}

						this.page1++
						this.list1.push(...res.data.data)
					} else {
						this.kk1 = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			// 置顶
			sw_change(e) {
				let data = {
					friend_id: this.user_xx.id,
					is_top: e.detail.value ? '1' : '2'
				}
				this.post1('api/im/im/friend_top', data, false).then(res => {
					if (res.code == 1) {
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						this.page1 = 1
						this.enmpy1 = false
						this.kk1 = false
						this.list1 = []
						this.tongxunlv()
					} else {
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			// 取消关注
			qx_gz() {
				let that = this
				this.$refs.popup2.close()
				uni.showModal({
					title: '提示',
					content: '您确定取消关注该用户？',
					success(res) {
						if (res.confirm) {
							that.post1('api/im/im/cancel_attention_friend', {
								friend_id: that.user_xx.id
							}, false).then(res => {
								if (res.code == 1) {
									uni.showToast({
										title: res.msg,
										icon: "none",
										duration: 1000
									})
									that.list1.splice(that.index, 1)
								} else {
									uni.showToast({
										title: res.msg,
										icon: "none",
										duration: 1000
									})
								}
							})
						} else if (res.cancel) {
							that.$refs.popup2.open()
						}
					}
				});
			},
			// 设置备注名
			sz_bz() {
				this.name = this.user_xx.client_name
				this.$refs.popup2.close()
				this.$refs.popup3.open()
			},
			qingchu() {
				this.name = ''
			},
			bz_qx() {
				this.$refs.popup3.close()
				this.$refs.popup2.open()
			},
			bz_qr() {
				if (this.name == '') {
					uni.showToast({
						title: '请输入备注名',
						icon: "none",
						duration: 1000
					})
					return
				} else {
					this.post1('api/im/im/setFriendNickname', {
						friend_id: this.user_xx.id,
						client_name: this.name
					}, false).then(res => {
						this.$refs.popup3.close()
						if (res.code == 1) {
							uni.showToast({
								title: res.msg,
								icon: "none",
								duration: 1000
							})
							this.page1 = 1
							this.enmpy1 = false
							this.kk1 = false
							this.list1 = []
							this.tongxunlv()
						} else {
							uni.showToast({
								title: res.msg,
								icon: "none",
								duration: 1000
							})
						}
					})
				}
			},
			async tianjia() {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				// uni.navigateTo({
				// 	url: '/sub/pages/tianjia'
				// })
				this.xianshi = true
				this.$forceUpdate()
			},
			tan_guanbi() {
				this.xianshi = false
			},
			async tan_guanbi1() {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.xianshi = false
				uni.navigateTo({
					url: '/sub/pages/tianjia?index=' + 1
				})
			},
			async tan_guanbi2() {
				let that = this
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.xianshi = false
				uni.navigateTo({
					url: '/sub/pages/tianjia?index=' + 2
				})
			},
			async tan_guanbi3() {
				let that = this
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.xianshi = false
				that.post1('api/im/im/check_group', {
					group_id: ''
				}, false).then(re => {
					if (re.code == 1) {

						uni.navigateTo({
							url: '/sub/pages/tj_qunliao'
						})
					} else if (re.code == 211) {
						uni.showModal({
							title: '提示',
							content: re.msg,
							success(res1) {
								if (res1.confirm) {
									if (that.iosUpAppStore) {
										uni.navigateTo({
											url: '/subpages/pages/vip'
										})
									}
								} else if (res1.cancel) {

								}
							}
						});
					} else {
						uni.showToast({
							title: re.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			async sousuo() {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.navigateTo({
					url: '/sub/pages/xx_sousuo'
				})
			},
			shezhi(item, index) {
				this.user_xx = item
				this.name = item.client_name
				this.index = index
				this.$refs.popup2.open()
			},

			handleTabSwitch(index) {
				this.pan_status = index
				if (index == 1) {
					this.page = 1
					this.enmpy = false
					this.kk = false
					this.list = []
					this.tiezi()
					this.shuju()
				} else if (index == 2) {
					this.my_cj_qz()
					this.my_jr_qz()
				} else if (index == 3) {
					this.page1 = 1
					this.enmpy1 = false
					this.kk1 = false
					this.list1 = []
					this.tongxunlv()
				} else if (index == 4) {
					this.page2 = 1
					this.enmpy2 = false
					this.kk2 = false
					this.list2 = []
					this.dckf()
				}
			},


			qunxiaoxi(id, index) {
				let that = this
				that.post1('api/im/im/check_group', {
					group_id: id
				}, false).then(re => {
					if (re.code == 1) {
						uni.navigateTo({
							url: '/sub/pages/qun_xiaoxi?id=' + id
						})
					} else if (re.code == 211) {
						uni.showModal({
							title: '提示',
							content: re.msg,
							success(res1) {
								if (res1.confirm) {
									if (that.iosUpAppStore) {
										uni.navigateTo({
											url: '/subpages/pages/vip'
										})
									}
								} else if (res1.cancel) {

								}
							}
						});
					} else {
						uni.showToast({
							title: re.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
				return
				this.post1('api/client/info', '', false).then(res => {
					if (res.code == 1) {
						if (res.data.is_vip == 1) {
							uni.navigateTo({
								url: '/sub/pages/qun_xiaoxi?id=' + id
							})
						} else if (res.data.is_vip == 2) {
							uni.showModal({
								title: '提示',
								content: '您的会员已到期,只有会员才可以编辑群组,请前去续费会员！',
								success(res1) {
									if (res1.confirm) {
										uni.navigateTo({
											url: '/subpages/pages/vip'
										})
									} else if (res1.cancel) {

									}
								}
							});
						} else if (res.data.is_vip == 0) {
							uni.showModal({
								title: '提示',
								content: '只有会员才可以编辑群组,请前去开通会员！',
								success(res1) {
									if (res1.confirm) {
										uni.navigateTo({
											url: '/subpages/pages/vip'
										})
									} else if (res1.cancel) {

									}
								}
							});
						}
					}
				})

			},
			shuju() {
				this.post1('api/chat', '', false).then(res => {
					if (res.code == 1) {
						this.zuixin = res.data
					} else {
						this.$refs.noLoginToast.open()
					}
				})
			},
			async tongzhi(index) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.navigateTo({
					url: '/sub/pages/my/tongzhi?index=' + index
				})
			},
			async sixin(id) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.navigateTo({
					url: '../../fenbao/pages/wenzhang/liaotian?roomid=' + id
				})
			},
			tiezi() {
				let data = {
					page: this.page,
					limit: 10
				}
				this.post1('api/im/im/friend_chat_list', data, false).then(res => {
					if (res.code == 1) {
						if (this.page == 1) {
							if (res.data.data == null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						} else {
							if (res.data.data == null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					} else if (res.code == 401) {
						this.$refs.noLoginToast.open()
					} else {
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			getSysHeightInfo() {
				const that = this
				let statusBarHeight, menuButtonObject, menuHeight, navheight, haveBack, btnHeight, btnWidth

				statusBarHeight = uni.getSystemInfoSync().statusBarHeight
				//#ifdef MP-WEIXIN
				menuButtonObject = uni.getMenuButtonBoundingClientRect()
				menuHeight = menuButtonObject.height + (menuButtonObject.top - statusBarHeight) * 2
				navheight = menuHeight + statusBarHeight
				btnHeight = menuButtonObject.height
				btnWidth = menuButtonObject.width
				//#endif

				//#ifdef APP-PLUS
				menuHeight = 12
				navheight = menuHeight + statusBarHeight
				this.chatHeader = statusBarHeight + 50
				//#endif

				//#ifdef H5
				menuHeight = 16
				navheight = menuHeight + statusBarHeight
				btnHeight = 30
				btnWidth = 70
				this.chatHeader = 50
				//#endif
				if (getCurrentPages().length === 1) { // 当只有一个页面时
					haveBack = false;
				} else {
					haveBack = true;
				}
				that.navheight = navheight
				that.statusBarHeight = statusBarHeight
				that.menuHeight = menuHeight
				that.haveBack = haveBack
			},
			// 用户信息
			xiaoxi() {
				uni.navigateTo({
					url: '../../fenbao/pages/wenzhang/liaotian'
				})
			},
			quxiao1() {
				this.$refs.popup1.close()
			},
			login1(e) {
				let that = this
				this.$refs.popup1.close()
				uni.login({
					provider: 'weixin',
					success: (code) => {
						this.post1('api/wechat/phone', {
							code: code.code,
							iv: e.detail.iv,
							encryptedData: e.detail.encryptedData
						}, false).then(res => {
							if (res.code == 1) {
								uni.setStorageSync('mobile', res.data.phoneNumber)
								uni.setStorageSync('mobile2', res.data.mobile2)
								that.zhezhao = true
								that.denglu_im()
								that.tankuang()
							} else {
								uni.showToast({
									title: res.msg,
									icon: "none",
									duration: 1000
								})
							}

						})

					}
				})
			},


		},
		mounted() {
			const that = this
			this.getSysHeightInfo()
			//#ifdef H5
			window.onscroll = function() {
				var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
				if (scrollTop > 30) {
					that.isScroll = true
				} else {
					that.isScroll = false
				}
			}
			//#endif

		},
		onPageScroll(t) {

			t.scrollTop > 20 ? this.xiao = false : this.xiao = true;
			// t.scrollTop > 80 ? this.da = true : this.da = false;

		},
		watch: {
			scrollTop(newValue, oldValue) {
				//#ifdef MP-WEIXIN
				const that = this
				if (newValue > 1) {
					that.isScroll = true
				} else {
					that.isScroll = false
				}
				//#endif
			}
		},
		filters: {
			caculateTimeago(dateTimeStamp) {
				const minute = 1000 * 60; // 把分，时，天，周，半个月，一个月用毫秒表示

				const hour = minute * 60;
				const day = hour * 24;
				const week = day * 7;
				const now = new Date().getTime(); // 获取当前时间毫秒

				const diffValue = now - dateTimeStamp; // 时间差

				let result = "";

				if (diffValue < 0) {
					return;
				}

				const minC = diffValue / minute; // 计算时间差的分，时，天，周，月

				const hourC = diffValue / hour;
				const dayC = diffValue / day;
				const weekC = diffValue / week;

				if (weekC >= 1 && weekC <= 4) {
					result = ` ${parseInt(weekC, 10)}周前`;
				} else if (dayC >= 1 && dayC <= 6) {
					result = ` ${parseInt(dayC, 10)}天前`;
				} else if (hourC >= 1 && hourC <= 23) {
					result = ` ${parseInt(hourC, 10)}小时前`;
				} else if (minC >= 1 && minC <= 59) {
					result = ` ${parseInt(minC, 10)}分钟前`;
				} else if (diffValue >= 0 && diffValue <= minute) {
					result = "刚刚";
				} else {
					const datetime = new Date();
					datetime.setTime(dateTimeStamp);
					const Nyear = datetime.getFullYear();
					const Nmonth =
						datetime.getMonth() + 1 < 10 ?
						`0${datetime.getMonth() + 1}` :
						datetime.getMonth() + 1;
					const Ndate =
						datetime.getDate() < 10 ?
						`0${datetime.getDate()}` :
						datetime.getDate();
					result = `${Nyear}-${Nmonth}-${Ndate}`;
				}

				return result;
			}
		}
	}
</script>

<style lang="scss">
	.zhaoren {
		position: absolute;
		right: 30rpx;
	}

	.pan_active {
		color: #fff;
		font-size: 42rpx;
		line-height: 48rpx;
		padding-bottom: 20rpx;
		opacity: 1;
	}

	.pan_as {
		color: #fff;
		font-size: 26rpx;
		line-height: 48rpx;
		padding-bottom: 20rpx;
		opacity: 0.6;
	}

	.pan_active::after {
		content: '';
		display: block;
		position: absolute;
		left: 50%;
		bottom: 0rpx;
		right: 0;
		width: 60rpx;
		height: 20rpx;
		transform: translateX(-50%);
		background: url('../../static/my/tab-line.png') no-repeat;
		background-size: 100%;
	}

	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;
		}
	}

	page {
		background-color: #F8F8F8 !important;
		font-family: Demibold;
	}

	.bg {
		width: 100%;
	}

	.hai {
		text-align: center;
		font-size: 27rpx;
		color: #FFFFFF;
	}

	.sou {
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		border-radius: 40rpx;
		color: #FFFFFF;
		font-size: 26rpx;
		box-sizing: border-box;
		padding: 0 30rpx 0 80rpx;
		background-color: rgba(255, 255, 255, .3);
	}

	.suo {
		color: #FFFFFF;
		opacity: 1;
		font-size: 26rpx;
	}

	.souicon {
		width: 30rpx;
		height: 30rpx;
		position: absolute;
		top: 50%;
		left: 30rpx;
		transform: translateY(-50%);

	}

	.addcity {
		position: absolute;
		top: 50%;
		left: 0;
		transform: translateY(-50%);
		font-size: 28rpx;
	}

	.shang_city {
		width: 100%;
		box-sizing: border-box;
		padding-bottom: 200rpx;
	}

	.lunbo {
		width: 92%;
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		box-sizing: border-box;
	}



	// 头部
	.navbar {
		width: 100%;
		overflow: hidden;
		top: 0;
		left: 0;
		z-index: 999;
		flex-shrink: 0;
		color: #fff;
		font-size: 16px;
	}

	.nav-normal {
		position: relative;
	}

	.nav-fixed {
		position: fixed;
	}

	.header {
		position: fixed;
		width: 100%;
	}

	.logo-centent {
		display: flex;
		align-items: center;
	}

	.logo-centent image {
		width: 260rpx;
		height: 68rpx;
		margin-left: 20rpx;
	}

	.hearder-status {
		display: flex;
		align-items: center;
		position: absolute;
		padding-left: 30rpx;
		height: 100%;
		z-index: 99999;

	}

	.header-title {
		height: 100%;
		left: 0;
		right: 0;
		position: absolute;
		margin: auto;
		text-align: center;
	}

	.header-title image {
		position: absolute;
		width: 270rpx;
		height: 35rpx;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}

	.header-title-left {
		height: 100%;
		left: 0;
		right: 0;
		position: absolute;
		margin: auto;
		text-align: left;
	}

	.back-text {
		margin-left: 7px;
		width: 100upx;
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
	}

	.hearder-status .nav-title-left {
		display: flex;
		justify-content: space-between;
		align-items: center;
		color: rgba(0, 0, 0, .8);
		width: 100%;
		font-weight: bold;
	}

	.hearder-status .nav-btn {
		/* background-color: rgba(255, 255, 255, .5);
		border-radius: 15px; */
		display: flex;
		justify-content: space-between;
		align-items: center;
		color: rgba(0, 0, 0, .8);
		width: 50%;
		font-weight: bold;
	}

	.hearder-status .nav-btn .gotback,
	.hearder-status .nav-btn .gothome {
		flex: 1;
		text-align: center;
		font-size: 18px;
	}

	.Addslot {
		position: absolute;
		width: 100%;
	}











	.t-conversation-item-container {
		width: 100%;
		height: 140rpx;
		background-color: #ffffff;
	}

	.t-conversation-item {
		width: 100%;
		height: 140rpx;
		display: flex;
		left: 0;
		align-items: center;
		justify-content: flex-start;
		box-sizing: border-box;
	}

	.avatar-box {
		position: relative;
		display: inline-flex;
	}

	.t-conversation-item-avatar {
		position: relative;
		width: 110rpx;
		height: 110rpx;
		border-radius: 50%;
		/*  margin: 0 16rpx; */
		overflow: auto;
		margin-top: 14rpx;
		display: block;

	}

	.t-conversation-item-content {
		/* max-width: 60%; */
		/* flex: 1; */
		padding-left: 20rpx;
	}

	.t-conversation-item-info {
		line-height: 34rpx;
		font-size: 24rpx;
		color: #999999;
		/* margin-right: 30rpx; */
	}

	.t-error {
		background-color: #fb5250;
		color: #fff;
	}

	.t-conversation-delete {
		width: 144rpx;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #e85454;
		color: #ffffff;
		line-height: 44rpx;
		font-size: 32rpx;
	}

	.tui-conversation-item-name {
		line-height: 53rpx;
		font-size: 36rpx;
		font-family: "PingFangSC-Regular";
		color: #333333;
	}

	.tui-conversation-lastMessage {
		line-height: 40rpx;
		font-size: 28rpx;
		font-family: "PingFangSC-Regular";
		color: #999999;
		max-width: 90%;
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
	}

	.unread {
		top: 14rpx;
		right: 0rpx;
		position: absolute;
		padding: 0 10rpx;
		height: 15px;
		border-radius: 50%;
		color: #ffffff;
		background-color: red;
		z-index: 100;
	}

	.read-text {
		line-height: 15px;
		font-size: 10px;
	}

	.search_people {
		color: #fff;
		font-size: 30rpx;
		display: block;
		width: calc(50% - 10rpx);
		height: 100rpx;
		padding-left: 24rpx;
		margin-right: 10rpx;
		line-height: 100rpx;
		background: url('../../static/msg/search-people.png') no-repeat;
		background-size: 100%;
	}

	.search_group {
		color: #fff;
		font-size: 30rpx;
		display: block;
		width: calc(50% - 10rpx);
		margin-left: 10rpx;
		box-sizing: border-box;
		height: 100rpx;
		padding-left: 24rpx;
		line-height: 100rpx;
		background: url('../../static/msg/search-group.png') no-repeat;
		background-size: 100%;
	}
	.gradient_bg1,.chat_header_bg{
		position: relative;
		width: 100%;
		height: 800rpx;
		background: linear-gradient(180deg, #5EC4C2 0%, #F5F5F5 100%);
		padding: 0 30rpx;
		box-sizing: border-box;
	}
	.chat_header_bg {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 0;
	}
	.gradient_bg1.active {
		/* #ifdef APP || MP-WEIXIN */
		padding-top: 200rpx;
		/* #endif */
		/* #ifdef H5 */
		padding-top: 120rpx;
		/* #endif */
	}
	.chat_header {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 9999;
		height: 100rpx;
		padding: 30rpx 30rpx 20rpx;
		box-sizing: border-box;
		overflow: hidden;
	}
	.chat_nav {
		height: 100rpx;
		position: relative;
		z-index: 99999;
	}
	.chat_nav /deep/ .tab_nav {
		margin-bottom: 0;
	}
</style>